import {Input} from 'antd';
import React, {useState} from 'react';

/**
 * 防止浏览器自动填充密码
 */
const ReadonlyPassword: React.FC<any> = (props) => {
	const [readonly, setReadonly] = useState<boolean>(true);
	return <Input.Password readOnly={readonly} onFocus={() => setReadonly(false)} {...props}/>
};

export default ReadonlyPassword;
